from tortoise.models import Model
from tortoise import fields

class User(Model):
    id = fields.BigIntField(pk=True, generated=True)
    username = fields.CharField(max_length=64)
    password = fields.CharField(max_length=255)
    phone = fields.CharField(max_length=20, null=True)
    email = fields.CharField(max_length=20, null=True)
    banned = fields.BooleanField(default=0, null=True)
    avatar = fields.CharField(max_length=255, null=True)
    token = fields.CharField(max_length=255, null=True)
    create_time = fields.DatetimeField(auto_now_add=True, null=True)
    update_time = fields.DatetimeField(auto_now=True, null=True)
    del_flag = fields.BooleanField(default=0, null=True)

    class Meta:
        table = 't_user'
